home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 176-200 / scopedisk180 / arexxtutorial / rexxarplib / dofor.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  352b  |  29 lines

  1. /** dofor.rexx
  2. *
  3. *   This function does 'oper' for all 'fn'.
  4. *
  5. **/
  6. parse arg fn oper
  7.  
  8. oper = strip(oper)
  9.  
  10. if fn = "" then do
  11.    say "Usage: dofor <wildcards> <operation>"
  12.    exit
  13. end
  14.  
  15. call filelist(fn, files, F)
  16.  
  17. if files.0 = 0 then do
  18.    say "No files found"
  19.    exit
  20. end
  21.  
  22. do i = 1 to files.0
  23.    if files.i = "" then leave
  24.  
  25.    oper' 'files.i
  26. end
  27.  
  28. exit
  29.